package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxfw_wine;
import cn.bj.dao.Yxfw_wineMapper;

@Service
public class WineService {
	@Autowired
	Yxfw_wineMapper yxfw_wineMapper;

	// 查询所有
	public List<Yxfw_wine> getAllWines() {
		return yxfw_wineMapper.selectByExample(null);
	}

	// 插入
	public int insrtWine(Yxfw_wine wine) {
		return yxfw_wineMapper.insert(wine);
	}

	// 删除
	public int deleteWine(Integer id) {
		return yxfw_wineMapper.deleteByPrimaryKey(id);
	}

	// 修改
	public int updateWine(Yxfw_wine wine) {
		return yxfw_wineMapper.updateByPrimaryKey(wine);
	}

	// 查询单个
	public Yxfw_wine selectById(Integer id) {
		return yxfw_wineMapper.selectByPrimaryKey(id);
	}
}
